package com.campus.controller;

import com.campus.mapper.TeacherMapper;
import com.campus.service.ITeacherService;
import com.campus.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teacher")
public class TeacherController {

    @Autowired
    private ITeacherService iTeacherService;

    @PostMapping("/create")
    public R create(Integer id, String teacherName, String subject, String profession, String school, String introduce, Integer loginId)
    {
        return R.success(iTeacherService.createTeacher(id, teacherName, subject, profession, school, introduce, loginId));
    }

    @GetMapping("/query")
    public R query(Integer id,String teacherName,String subject)
    {
        return R.success("查询成功",iTeacherService.queryTeacher(id, teacherName, subject));
    }
}
